#include "LabelHTCell.h"
//necessary
#include "memory-tools.h"


PlabelHTCell initLabelHTCell(Plabel _label){
	PlabelHTCell result=(PlabelHTCell)mallocMemory(sizeof(LabelHTCell),"LabelHashTable.c:initLabelHT:1");
	result->key=_label->name;
	result->label=_label;
	return result;
}


void freeLabelHTCell(PlabelHTCell pcell){
	freeLabel(pcell->label);
	//pcell-key is automatically freed by the previous call
	freeMemory(sizeof(LabelHTCell),pcell);
}


void printLabelHTCell(FILE* f,PlabelHTCell pcell){
	fprintf(f,"[%s -> ",pcell->key);
	printLabel(f,pcell->label);
	fprintf(f,"]");
}


void generateDOTLabelHTCell(FILE* f,PlabelHTCell pcell,int nodenumber){
	fprintf(f,"n%03d [label=\"",nodenumber);
	printLabel(f,pcell->label);
	fprintf(f,"\" shape=\"rect\"];");
}
